import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../components/PageWrap.dart';

class PaddingLn extends StatefulWidget {
  const PaddingLn({super.key});

  @override
  State<PaddingLn> createState() => _PaddingLnState();
}

class _PaddingLnState extends State<PaddingLn> {
  @override
  Widget build(BuildContext context) {
    return PageWrap(
      title: "填充",
      children: <Widget>[
        Padding(
            //上下左右各添加16像素补白
            padding: const EdgeInsets.all(16),
            child: Column(
              //显式指定对齐方式为左对齐，排除对齐干扰
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: const <Widget>[
                Padding(
                  //左边添加8像素补白
                  padding: EdgeInsets.only(left: 8),
                  child: Text("Hello world"),
                ),
                Padding(
                  //上下各添加8像素补白
                  padding: EdgeInsets.symmetric(vertical: 8),
                  child: Text("I am Jack"),
                ),
                Padding(
                  // 分别指定四个方向的补白
                  padding: EdgeInsets.fromLTRB(20, 0, 20, 20),
                  child: Text("Your friend"),
                )
              ],
            ))
      ],
    );
  }
}
